<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<?php 
$passParts = false;
$passRepair = false;

?>
<body style="font-family:Arial, Helvetica, sans-serif;">
<h1>Close Job ID: <?php echo $this->idJob;?><br />
</h1>

<table width="800" border="1" cellspacing="0" cellpadding="10">
  <?php if($this->isFixed == true && empty($this->rMlist)){ 
  $passParts = false
  ?>
  <tr>
    <td bgcolor="#FF6666">We do not record any parts consumption of the JOB, if it is a serivce only job , the parts &quot;Service&quot; need to be recorded</td>
  </tr>
  <?php }
   if($this->isFixed == false && empty($this->rMlist)){
	   $passParts = true;
	   }
   if($this->isFixed == true && !empty($this->rMlist)){
	   $passParts = true;
	   } 
  
  ?>
  <?php if($this->isFixed == false && $this->partsDoesUsed ){ 
  $passParts = false;
  ?>
    <tr>
    <td bgcolor="#FF6666">Since we did not fix the phone, there should be<strong> NO</strong> parts Confumption for this job , Please click the button at the bottom  ,go to parts record , do &quot;<strong>Error Correction</strong>&quot;  for the following parts recorded in the job.</td>
  </tr>
  <?php }?>
  <tr>
    <td <?php //bgcolor="#33CC33"?> >
    <?php if(empty($this->rMlist)){
     echo "We have No Parts Consumption Record";
    }else{
	echo "We have the following Record:<br />";	
	foreach($this->rMlist as $k => $v){
		echo "[".$v[0]."] x ".$v['2'].": ".$v[1]."(".$v[3].")<br />";
		}	
	}
    ?></td>
  </tr>
  <tr>
    <td align="center"><strong>The Phone is Repaired By:</strong></td>
  </tr>
  <?php if(trim($this->rListName)==''){
	  if($this->isFixed == false){
		  $passRepair = true;
		  }
		else{
			$passRepair = false;
			}  
	  ?>
  <tr>
    <td align="center" bgcolor="<?php echo ($this->isFixed)?'#FF6666':'#33CC33'; ?>" >we do not have any repair technician record</td>
  </tr>
  <?php }
  else{
	  $passRepair = true;
  ?>
  <tr>
    <td align="center" bgcolor="#33CC33"><?php echo $this->rListName;?></td>
  </tr>
  <?php }?>
</table>
<br />
<br />
<br />
<table width="800" border="0" cellspacing="0" cellpadding="10">  
<?php if($passParts && $passRepair) {?>  
  <tr>
    <td align="center"><form id="form1" name="form1" method="post" action="/repaircenter/device-pickup-closejob/shop/<?php echo $this->shopCode?>">
  <input type="hidden" name="is_fix" value="<?php echo (int)$this->isFixed;?>" />	
  <input type="hidden" name="id_job" id="id_job" value="<?php echo $this->idJob;?>"   />
  <input type="hidden" name="name_staff" id="name_staff" value="<?php echo $_POST['name_staff'];?>"   />
  <br />
  <br />
  <input type="submit" name="button" id="button" value="Well Done, CLOSE The Job Now &amp;Return To Repair Center" style="font-size:18px;" />

  <label for="password"></label>
</form></td>
  </tr>
<?php } else {
	//d($passParts,$passRepair);
	
	?>  
  
  <tr>
    <td align="center"><form id="form1" name="form1" method="post" action="/repaircenter/showstatusbyjobid">
  <input type="hidden" name="id_job" id="id_job" value="<?php echo $this->idJob;?>"  />	 
     <input type="hidden" name="shop_head" id="shop_head" value="<?php echo $this->shopCode;?>" />
  <input type="submit" name="button5" id="button5" value="Sorry, Please Click Here To Filling the Above Incomplete / Incorrect Information" style="font-size:18px;" />
</form></td>
  </tr>
  <?php }?>
</table>
</body>
</html>
